<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>canps: xcanps_polled_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">canps
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xcanps__polled__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xcanps_polled_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>Contains an example of how to use the <a class="el" href="struct_x_can_ps.html" title="The XCanPs driver instance data. ">XCanPs</a> driver directly. </p>
<p>This example shows the using the driver/device in polled mode.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>None.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who    Date       Changes
</p>
<hr/>
<p>
1.00a xd/sv  01/12/10 First release
2.1 adk                 23/08/14 Fixed CR:798792 Peripheral test for CANPS IP in
                                         SDK claims a 40kbps baud rate but it's not.
3.7   ht     06/28/23 Added support for system device-tree flow.
      ht     07/10/23 Added support for peripheral test in SDT flow.
3.8   rma    01/12/23 Update example code to fix compilation warnings.
3.8   ht     01/19/24 Update example to fix peripheral test compilation warnings
                                and example compilation failure in SDT flow
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:af8aa7d4878295f728653a9dac181a310"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcanps__polled__example_8c.html#af8aa7d4878295f728653a9dac181a310">CanPsPolledExample</a> (u16 DeviceId)</td></tr>
<tr class="memdesc:af8aa7d4878295f728653a9dac181a310"><td class="mdescLeft">&#160;</td><td class="mdescRight">The entry point for showing the <a class="el" href="struct_x_can_ps.html" title="The XCanPs driver instance data. ">XCanPs</a> driver in polled mode.  <a href="#af8aa7d4878295f728653a9dac181a310">More...</a><br/></td></tr>
<tr class="separator:af8aa7d4878295f728653a9dac181a310"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xcanps__polled__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the main function of the Can polled example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="af8aa7d4878295f728653a9dac181a310"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int CanPsPolledExample </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DeviceId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The entry point for showing the <a class="el" href="struct_x_can_ps.html" title="The XCanPs driver instance data. ">XCanPs</a> driver in polled mode. </p>
<p>The example configures the device for internal loop back mode, then sends a Can frame, receives the same Can frame, and verifies the frame contents.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DeviceId</td><td>is the XPAR_&lt;CANPS_instance&gt;_DEVICE_ID value from xparameters.h</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise driver-specific error code.</dd></dl>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>If the device is not working correctly, this function may enter an infinite loop and will never return to the caller. </p>

<p>References <a class="el" href="struct_x_can_ps___config.html#aead9a19a4d9084512a482d1d5ae41bc9">XCanPs_Config::BaseAddr</a>, <a class="el" href="group__canps.html#ga458b97ea8e4dbb67edb27687a41ebd87">XCanPs_CfgInitialize()</a>, <a class="el" href="group__canps.html#ga5a32b11e15d347ecae566778bb1c5e33">XCanPs_EnterMode()</a>, <a class="el" href="group__canps.html#ga3644ad3aa2b02def735751ed45d207a4">XCanPs_GetMode()</a>, <a class="el" href="group__canps.html#ga3d3245fb9be426b1f1cca0b20ea90905">XCanPs_LookupConfig()</a>, <a class="el" href="group__canps.html#ga4e4f2c00506467b58276539cc1c2333e">XCANPS_MODE_CONFIG</a>, <a class="el" href="group__canps.html#ga815748d9ef7547d7fd43f2b729c3108c">XCANPS_MODE_LOOPBACK</a>, <a class="el" href="group__canps.html#ga84d18d801c4f8ab5cc8eeadeff33d8b5">XCanPs_SelfTest()</a>, <a class="el" href="group__canps.html#ga0e266c7af58c3b5eaef6e4dcd2354cbe">XCanPs_SetBaudRatePrescaler()</a>, and <a class="el" href="group__canps.html#gac42876be22acc7e24262120000c4c548">XCanPs_SetBitTiming()</a>.</p>

<p>Referenced by <a class="el" href="xcanps__polled__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the main function of the Can polled example. </p>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="xcanps__polled__example_8c.html#af8aa7d4878295f728653a9dac181a310">CanPsPolledExample()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
